\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{margin=1.5cm, vmargin={0pt,1cm}}
\setlength{\topmargin}{-1cm}
\setlength{\paperheight}{29.7cm}
\setlength{\textheight}{25.3cm}

% useful packages.
\usepackage{ctex}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{fancyhdr}
\usepackage{layout}
\usepackage{setspace}
\usepackage{float}
\usepackage[table,xcdraw]{xcolor}

% some common command
\newcommand{\dif}{\mathrm{d}}
\newcommand{\avg}[1]{\left\langle #1 \right\rangle}
\newcommand{\difFrac}[2]{\frac{\dif #1}{\dif #2}}
\newcommand{\pdfFrac}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\OFL}{\mathrm{OFL}}
\newcommand{\UFL}{\mathrm{UFL}}
\newcommand{\fl}{\mathrm{fl}}
\newcommand{\op}{\odot}
\newcommand{\Eabs}{E_{\mathrm{abs}}}
\newcommand{\Erel}{E_{\mathrm{rel}}}

\large
\setlength{\headheight}{20pt}
\begin{document}
\pagestyle{fancy}
\fancyhead{}
\lhead{Chen JiaRui}
\chead{Numerical Solutions of Differential Equations - Project \#2}
\rhead{2021.06.08}

\title{Project \#2 - Math Doucument}
\author{陈嘉锐  3180101998}
\maketitle

\begin{spacing}{1.2}

\section{一维情形}
\subsection{非齐次边值: $u(x) = \exp(\sin(x))$}
由于数据太多，此处仅展示部分数据，具体数据可以在 data/ 目录下找到。

\subsubsection{V-Cycle的几个代表例子}
由于基本在前十几次迭代相对误差就趋于稳定降不下去了，所以此处仅列出15次迭代的数据。
\begin{table}[H]
\centering
\caption{n=128, VCycle, Injection, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & Error       & Ratio     & Residual    & Ratio     \\ \hline
1         & 0.805618    & 0         & 529.593     & 0         \\ \hline
2         & 0.0672436   & 0.0834683 & 43.6105     & 0.0823471 \\ \hline
3         & 0.0122583   & 0.182297  & 3.79738     & 0.087075  \\ \hline
4         & 0.00126672  & 0.103335  & 0.354415    & 0.0933316 \\ \hline
5         & 0.000181524 & 0.143303  & 0.0330248   & 0.0931812 \\ \hline
6         & 2.34761e-05 & 0.129328  & 0.00326828  & 0.0989642 \\ \hline
7         & 5.51902e-06 & 0.235091  & 0.000323821 & 0.0990801 \\ \hline
8         & 3.39567e-06 & 0.615267  & 3.28622e-05 & 0.101482  \\ \hline
9         & 3.12479e-06 & 0.920228  & 3.54552e-06 & 0.107891  \\ \hline
10        & 3.09537e-06 & 0.990584  & 3.81951e-07 & 0.107728  \\ \hline
11        & 3.09135e-06 & 0.998704  & 4.13195e-08 & 0.10818   \\ \hline
12        & 3.09094e-06 & 0.999867  & 4.4813e-09  & 0.108455  \\ \hline
13        & 3.09089e-06 & 0.999981  & 5.09337e-10 & 0.113658  \\ \hline
14        & 3.09088e-06 & 0.999998  & 5.82276e-11 & 0.11432   \\ \hline
15        & 3.09088e-06 & 1         & 2.58583e-11 & 0.44409   \\  \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n=256, VCycle, FullWeighting, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & Error       & Ratio     & Residual    & Ratio     \\ \hline
1         & 0.220561    & 0         & 4169.7      & 0         \\ \hline
2         & 0.0191691   & 0.0869103 & 246.799     & 0.0591887 \\ \hline
3         & 0.0017287   & 0.0901819 & 20.3233     & 0.0823475 \\ \hline
4         & 0.00015443  & 0.0893331 & 1.63095     & 0.0802504 \\ \hline
5         & 1.37428e-05 & 0.0889901 & 0.130894    & 0.0802562 \\ \hline
6         & 1.69107e-06 & 0.123052  & 0.0105686   & 0.0807418 \\ \hline
7         & 8.53977e-07 & 0.504992  & 0.000859463 & 0.0813222 \\ \hline
8         & 7.80027e-07 & 0.913405  & 7.0381e-05  & 0.0818895 \\ \hline
9         & 7.73369e-07 & 0.991464  & 5.8002e-06  & 0.0824115 \\ \hline
10        & 7.72766e-07 & 0.999221  & 4.80751e-07 & 0.0828852 \\ \hline
11        & 7.72712e-07 & 0.999929  & 4.00902e-08 & 0.0833907 \\ \hline
12        & 7.72707e-07 & 0.999994  & 3.36115e-09 & 0.0838398 \\ \hline
13        & 7.72706e-07 & 0.999999  & 3.34354e-10 & 0.099476  \\ \hline
14        & 7.72706e-07 & 1         & 6.26883e-11 & 0.187491  \\ \hline
15        & 7.72706e-07 & 1         & 6.97569e-11 & 1.11276   \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n=512, VCycle, Injection, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & Error       & Ratio     & Residual    & Ratio     \\ \hline
1         & 0.989515    & 0         & 9415.28     & 0         \\ \hline
2         & 0.0418266   & 0.0422698 & 395.744     & 0.0420321 \\ \hline
3         & 0.0102699   & 0.245534  & 30.5735     & 0.0772558 \\ \hline
4         & 0.0019247   & 0.187412  & 2.90558     & 0.0950359 \\ \hline
5         & 0.000274482 & 0.14261   & 0.373319    & 0.128483  \\ \hline
6         & 3.6112e-05  & 0.131564  & 0.0427828   & 0.114601  \\ \hline
7         & 4.13989e-06 & 0.11464   & 0.00457076  & 0.106836  \\ \hline
8         & 6.73798e-07 & 0.162757  & 0.000459269 & 0.10048   \\ \hline
9         & 1.45486e-07 & 0.21592   & 4.32296e-05 & 0.094127  \\ \hline
10        & 1.9804e-07  & 1.36123   & 3.76502e-06 & 0.0870935 \\ \hline
11        & 1.9271e-07  & 0.973084  & 2.94848e-07 & 0.0783125 \\ \hline
12        & 1.93219e-07 & 1.00264   & 1.92403e-08 & 0.0652549 \\ \hline
13        & 1.93172e-07 & 0.99976   & 1.74279e-09 & 0.09058   \\ \hline
14        & 1.93176e-07 & 1.00002   & 5.11843e-10 & 0.293692  \\ \hline
15        & 1.93176e-07 & 0.999999  & 4.36328e-10 & 0.852464  \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n=1024, VCycle, FullWeighting, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & Error       & Ratio     & Residual    & Ratio     \\ \hline
1         & 0.0732675   & 0         & 23412.3     & 0         \\ \hline
2         & 0.00204092  & 0.0278557 & 475.395     & 0.0203054 \\ \hline
3         & 5.27674e-05 & 0.0258547 & 13.1974     & 0.0277609 \\ \hline
4         & 1.53071e-06 & 0.0290086 & 0.610329    & 0.0462462 \\ \hline
5         & 6.77941e-08 & 0.0442894 & 0.0172154   & 0.0282067 \\ \hline
6         & 4.87361e-08 & 0.718884  & 0.000731256 & 0.0424769 \\ \hline
7         & 4.83041e-08 & 0.991136  & 2.96386e-05 & 0.0405311 \\ \hline
8         & 4.82943e-08 & 0.999796  & 1.14802e-06 & 0.0387338 \\ \hline
9         & 4.82939e-08 & 0.999991  & 5.05603e-08 & 0.0440414 \\ \hline
10        & 4.82939e-08 & 1         & 2.73393e-09 & 0.0540727 \\ \hline
11        & 4.82939e-08 & 1         & 1.5938e-09  & 0.582972  \\ \hline
12        & 4.82939e-08 & 1         & 1.34016e-09 & 0.840854  \\ \hline
13        & 4.82939e-08 & 0.999999  & 1.56699e-09 & 1.16926   \\ \hline
14        & 4.82939e-08 & 0.999999  & 1.16258e-09 & 0.741917  \\ \hline
15        & 4.82939e-08 & 1         & 1.38745e-09 & 1.19342   \\ \hline
\end{tabular}
\end{table}


\subsubsection{V-Cycle 不同 n 的对比}
\begin{table}[H]
\centering
\caption{VCycle, FullWeighting, Linear}
\begin{tabular}{|c|l|l|}
\hline
n    & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Residual} \\ \hline
128  & 3.09088e-06                & 1.69167e-11                   \\ \hline
256  & 7.72706e-07                & 6.97569e-11                   \\ \hline
512  & 1.93176e-07                & 2.71748e-10                   \\ \hline
1024 & 4.82939e-08                & 1.62568e-09                   \\ \hline
\end{tabular}
\end{table}


\subsubsection{Full multigrid cycle}
\begin{table}[H]
\centering
\caption{Full multigrid cycle, FullWeighting, Linear}
\begin{tabular}{|c|l|l|}
\hline
n    & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Residual} \\ \hline
128  & 3.09088e-06                & 1.7153e-08                    \\ \hline
256  & 7.72707e-07                & 6.86119e-08                   \\ \hline
512  & 1.93176e-07                & 2.74786e-07                   \\ \hline
1024 & 4.82939e-08                & 1.09912e-06                   \\ \hline
\end{tabular}
\end{table}

\subsection{齐次边值问题: $u(x) = x(1-x)\sin(x)$}
\subsubsection{V-Cycle}
\begin{table}[H]
\centering
\caption{n = 128, V-Cycle, Injection, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.0124611   & 0         & 0.466747    & 0         \\ \hline
2  & 0.00113582  & 0.0911487 & 0.0702504   & 0.150511  \\ \hline
3  & 0.000104984 & 0.0924303 & 0.0100097   & 0.142485  \\ \hline
4  & 5.53804e-06 & 0.0527513 & 0.00134826  & 0.134696  \\ \hline
5  & 4.49311e-06 & 0.811318  & 0.000172533 & 0.127967  \\ \hline
6  & 3.68703e-06 & 0.820597  & 2.10863e-05 & 0.122216  \\ \hline
7  & 3.75288e-06 & 1.01786   & 2.47156e-06 & 0.117212  \\ \hline
8  & 3.74787e-06 & 0.998666  & 2.78677e-07 & 0.112753  \\ \hline
9  & 3.7482e-06  & 1.00009   & 3.0287e-08  & 0.108681  \\ \hline
10 & 3.74819e-06 & 0.999996  & 3.17588e-09 & 0.104859  \\ \hline
11 & 3.74819e-06 & 1         & 3.21344e-10 & 0.101183  \\ \hline
12 & 3.74819e-06 & 1         & 3.13269e-11 & 0.0974873 \\ \hline
13 & 3.74819e-06 & 1         & 2.94964e-12 & 0.0941567 \\ \hline
14 & 3.74819e-06 & 1         & 2.63878e-12 & 0.89461   \\ \hline
15 & 3.74819e-06 & 1         & 1.33049e-12 & 0.504207  \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 256, V-Cycle, FullWeighting, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.0012488   & 0         & 0.201475    & 0         \\ \hline
2  & 3.75419e-05 & 0.0300625 & 0.0097994   & 0.0486384 \\ \hline
3  & 2.60703e-06 & 0.0694432 & 0.000236856 & 0.0241705 \\ \hline
4  & 9.8887e-07  & 0.379308  & 1.2388e-05  & 0.0523016 \\ \hline
5  & 9.37188e-07 & 0.947737  & 3.70145e-07 & 0.0298794 \\ \hline
6  & 9.37009e-07 & 0.999809  & 2.17837e-08 & 0.0588517 \\ \hline
7  & 9.37082e-07 & 1.00008   & 8.33094e-10 & 0.038244  \\ \hline
8  & 9.37086e-07 & 1         & 4.54086e-11 & 0.0545059 \\ \hline
9  & 9.37086e-07 & 1         & 6.31539e-12 & 0.139079  \\ \hline
10 & 9.37086e-07 & 1         & 4.52482e-12 & 0.716476  \\ \hline
11 & 9.37086e-07 & 1         & 5.09592e-12 & 1.12621   \\ \hline
12 & 9.37086e-07 & 1         & 5.40634e-12 & 1.06092   \\ \hline
13 & 9.37086e-07 & 1         & 3.48077e-12 & 0.643831  \\ \hline
14 & 9.37086e-07 & 1         & 3.34133e-12 & 0.959939  \\ \hline
15 & 9.37086e-07 & 1         & 7.82041e-12 & 2.34051   \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 512, V-Cycle, Injection, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.000770349 & 0          & 0.469427    & 0        \\ \hline
2  & 0.00179791  & 2.33389    & 0.0447087   & 0.095241 \\ \hline
3  & 1.50981e-05 & 0.00839758 & 0.0070536   & 0.157768 \\ \hline
4  & 2.38884e-05 & 1.58221    & 0.000736242 & 0.104378 \\ \hline
5  & 8.42399e-08 & 0.0035264  & 0.000108063 & 0.146777 \\ \hline
6  & 1.0027e-07  & 1.19029    & 1.15881e-05 & 0.107234 \\ \hline
7  & 2.31296e-07 & 2.30674    & 1.62798e-06 & 0.140487 \\ \hline
8  & 2.29724e-07 & 0.993204   & 1.78175e-07 & 0.109445 \\ \hline
9  & 2.34234e-07 & 1.01963    & 2.43296e-08 & 0.136549 \\ \hline
10 & 2.34207e-07 & 0.999887   & 2.70058e-09 & 0.111    \\ \hline
11 & 2.34271e-07 & 1.00027    & 3.55327e-10 & 0.131575 \\ \hline
12 & 2.3427e-07  & 0.999998   & 5.12583e-11 & 0.144257 \\ \hline
13 & 2.34271e-07 & 1          & 2.55964e-11 & 0.499361 \\ \hline
14 & 2.34271e-07 & 1          & 2.45475e-11 & 0.95902  \\ \hline
15 & 2.34271e-07 & 1          & 3.24931e-11 & 1.32368  \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 1024, V-Cycle, FullWeighting, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.0121428   & 0         & 0.59909     & 0         \\ \hline
2  & 0.00107124  & 0.0882207 & 0.0689501   & 0.115091  \\ \hline
3  & 9.44882e-05 & 0.0882044 & 0.00728776  & 0.105696  \\ \hline
4  & 8.2891e-06  & 0.0877263 & 0.000746451 & 0.102425  \\ \hline
5  & 6.79462e-07 & 0.0819705 & 7.49673e-05 & 0.100432  \\ \hline
6  & 8.85614e-09 & 0.013034  & 7.42023e-06 & 0.0989795 \\ \hline
7  & 5.29695e-08 & 5.98111   & 7.26091e-07 & 0.0978529 \\ \hline
8  & 5.80733e-08 & 1.09635   & 7.03885e-08 & 0.0969418 \\ \hline
9  & 5.85243e-08 & 1.00777   & 6.77481e-09 & 0.0962488 \\ \hline
10 & 5.85641e-08 & 1.00068   & 6.48527e-10 & 0.0957263 \\ \hline
11 & 5.85676e-08 & 1.00006   & 9.9361e-11  & 0.15321   \\ \hline
12 & 5.85679e-08 & 1.00001   & 9.74034e-11 & 0.980299  \\ \hline
13 & 5.85679e-08 & 1         & 9.89271e-11 & 1.01564   \\ \hline
14 & 5.8568e-08  & 1         & 8.24283e-11 & 0.833223  \\ \hline
15 & 5.8568e-08  & 1         & 8.20568e-11 & 0.995493  \\ \hline
\end{tabular}
\end{table}


\subsubsection{Full multigrid cycle}
\begin{table}[H]
\centering
\caption{Full multigrid cycle, Injection, Quadratic}
\begin{tabular}{|c|l|l|}
\hline
n    & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Residual} \\ \hline
128  & 3.74819e-06                & 6.9968e-11                    \\ \hline
256  & 9.37086e-07                & 4.90097e-11                   \\ \hline
512  & 2.34271e-07                & 3.16964e-11                   \\ \hline
1024 & 5.85678e-08                & 1.20699e-10                   \\ \hline
\end{tabular}
\end{table}



%--------------------------------------------------

\section{二维情形}
\subsection{非齐次边值问题: $u(x, y) = \exp(\sin(x)\sin(y))$}
\subsubsection{V-Cycle}
\begin{table}[H]
\centering
\caption{n = 128, V-Cycle, FullWeighting, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.516669    & 0        & 6741.38     & 0        \\ \hline
2  & 0.133862    & 0.259087 & 1247.55     & 0.185058 \\ \hline
3  & 0.0341858   & 0.25538  & 254.855     & 0.204285 \\ \hline
4  & 0.00854962  & 0.250092 & 52.3866     & 0.205555 \\ \hline
5  & 0.00212544  & 0.248601 & 10.7998     & 0.206155 \\ \hline
6  & 0.000524531 & 0.246787 & 2.24408     & 0.20779  \\ \hline
7  & 0.000128095 & 0.244209 & 0.469264    & 0.209111 \\ \hline
8  & 3.11894e-05 & 0.243487 & 0.0985427   & 0.209994 \\ \hline
9  & 7.79315e-06 & 0.249865 & 0.0207943   & 0.211018 \\ \hline
10 & 2.2377e-06  & 0.287137 & 0.00440262  & 0.211722 \\ \hline
11 & 9.56583e-07 & 0.427485 & 0.000936297 & 0.212668 \\ \hline
12 & 6.55887e-07 & 0.685656 & 0.000199847 & 0.213444 \\ \hline
13 & 5.8515e-07  & 0.892151 & 4.28013e-05 & 0.21417  \\ \hline
14 & 5.68552e-07 & 0.971635 & 9.18829e-06 & 0.214673 \\ \hline
15 & 5.64676e-07 & 0.993183 & 1.97915e-06 & 0.215399 \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 256, V-Cycle, FullWeighting, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.510703    & 0        & 28167.1     & 0        \\ \hline
2  & 0.125034    & 0.244826 & 5544.37     & 0.196839 \\ \hline
3  & 0.0300804   & 0.240578 & 1162.04     & 0.20959  \\ \hline
4  & 0.0070928   & 0.235795 & 246.384     & 0.212027 \\ \hline
5  & 0.00164507  & 0.231936 & 52.8282     & 0.214414 \\ \hline
6  & 0.000378238 & 0.229921 & 11.3743     & 0.215308 \\ \hline
7  & 8.64962e-05 & 0.228682 & 2.4578      & 0.216083 \\ \hline
8  & 1.96808e-05 & 0.227534 & 0.532947    & 0.216839 \\ \hline
9  & 4.49661e-06 & 0.228477 & 0.116149    & 0.217938 \\ \hline
10 & 1.0842e-06  & 0.241115 & 0.025408    & 0.218753 \\ \hline
11 & 3.36219e-07 & 0.310108 & 0.00556807  & 0.219146 \\ \hline
12 & 1.83362e-07 & 0.545363 & 0.00122141  & 0.21936  \\ \hline
13 & 1.50375e-07 & 0.820101 & 0.000268551 & 0.21987  \\ \hline
14 & 1.43005e-07 & 0.95099  & 5.91005e-05 & 0.220071 \\ \hline
15 & 1.41357e-07 & 0.988476 & 1.3013e-05  & 0.220185 \\ \hline
\end{tabular}
\end{table}


\begin{table}[H]
\centering
\caption{n = 512, V-Cycle, Injection, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 1.02218     & 0        & 106943      & 0        \\ \hline
2  & 0.404827    & 0.396042 & 20812.3     & 0.194612 \\ \hline
3  & 0.138446    & 0.341987 & 4187.3      & 0.201193 \\ \hline
4  & 0.043247    & 0.312375 & 852.366     & 0.20356  \\ \hline
5  & 0.0126923   & 0.293485 & 173.935     & 0.204061 \\ \hline
6  & 0.003546    & 0.279381 & 35.6435     & 0.204925 \\ \hline
7  & 0.000957482 & 0.270018 & 7.32821     & 0.205597 \\ \hline
8  & 0.000250924 & 0.262066 & 1.51244     & 0.206385 \\ \hline
9  & 6.44883e-05 & 0.257004 & 0.313145    & 0.207047 \\ \hline
10 & 1.62376e-05 & 0.251792 & 0.0650298   & 0.207667 \\ \hline
11 & 4.06199e-06 & 0.250159 & 0.0135436   & 0.208268 \\ \hline
12 & 1.01636e-06 & 0.250213 & 0.00282897  & 0.208879 \\ \hline
13 & 2.73679e-07 & 0.269273 & 0.000592069 & 0.209288 \\ \hline
14 & 9.17284e-08 & 0.335168 & 0.000124291 & 0.209926 \\ \hline
15 & 4.88669e-08 & 0.532735 & 2.61342e-05 & 0.210267 \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 1024, V-Cycle, Injection, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 1.0849      & 0        & 444014      & 0        \\ \hline
2  & 0.45357     & 0.418076 & 92268       & 0.207804 \\ \hline
3  & 0.153749    & 0.338975 & 19837.8     & 0.215002 \\ \hline
4  & 0.0464713   & 0.302254 & 4408.88     & 0.222246 \\ \hline
5  & 0.012934    & 0.278323 & 996.628     & 0.22605  \\ \hline
6  & 0.00342444  & 0.264762 & 228.951     & 0.229725 \\ \hline
7  & 0.000880284 & 0.257059 & 53.1785     & 0.23227  \\ \hline
8  & 0.000221935 & 0.252117 & 12.4621     & 0.234345 \\ \hline
9  & 5.52799e-05 & 0.249082 & 2.94653     & 0.236439 \\ \hline
10 & 1.36626e-05 & 0.247153 & 0.700863    & 0.237861 \\ \hline
11 & 3.36055e-06 & 0.245968 & 0.16726     & 0.238649 \\ \hline
12 & 8.28643e-07 & 0.246579 & 0.0400704   & 0.239569 \\ \hline
13 & 2.07579e-07 & 0.250505 & 0.00961072  & 0.239846 \\ \hline
14 & 5.65707e-08 & 0.272526 & 0.00231362  & 0.240734 \\ \hline
15 & 2.02578e-08 & 0.358098 & 0.000557104 & 0.240793 \\ \hline
\end{tabular}
\end{table}


\subsubsection{Full multigrid cycle}
\begin{table}[H]
\centering
\caption{Full multigrid cycle, Injection, Quadratic}
\begin{tabular}{|c|l|l|}
\hline
n & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Residual} \\ \hline
128 & 1.49642e-06                & 0.00321582                    \\ \hline
256 & 1.45806e-06                & 0.0133219                     \\ \hline
512 & 1.8201e-06                 & 0.0543504                     \\ \hline
1024 & 2.34268e-06                & 0.220104                      \\ \hline
\end{tabular}
\end{table}

\subsection{齐次边值问题: $u(x, y) = (x - 1)\sin(x)(y-1)\sin(y)$}
\subsubsection{V-Cycle}
\begin{table}[H]
\centering
\caption{n = 128, V-Cycle, Injection, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.00253037  & 0        & 1.97334     & 0        \\ \hline
2  & 0.00101756  & 0.402138 & 0.505531    & 0.256181 \\ \hline
3  & 6.66327e-05 & 0.065483 & 0.146658    & 0.290107 \\ \hline
4  & 5.63067e-05 & 0.845032 & 0.0328965   & 0.224308 \\ \hline
5  & 1.04244e-05 & 0.185136 & 0.00854885  & 0.259871 \\ \hline
6  & 3.91022e-06 & 0.375102 & 0.00176565  & 0.206536 \\ \hline
7  & 1.61365e-06 & 0.412675 & 0.000475816 & 0.269485 \\ \hline
8  & 2.19057e-07 & 0.135752 & 0.000119623 & 0.251406 \\ \hline
9  & 6.6247e-07  & 3.0242   & 3.8391e-05  & 0.320934 \\ \hline
10 & 5.20305e-07 & 0.785402 & 1.23517e-05 & 0.321735 \\ \hline
11 & 5.66314e-07 & 1.08843  & 3.9742e-06  & 0.321753 \\ \hline
12 & 5.52231e-07 & 0.975132 & 1.28073e-06 & 0.322262 \\ \hline
13 & 5.56774e-07 & 1.00823  & 4.12885e-07 & 0.322382 \\ \hline
14 & 5.55364e-07 & 0.997467 & 1.33251e-07 & 0.322732 \\ \hline
15 & 5.55818e-07 & 1.00082  & 4.30234e-08 & 0.322874 \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 256, V-Cycle, Injection, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.00534078  & 0         & 0.492063    & 0        \\ \hline
2  & 0.00191321  & 0.358227  & 0.173342    & 0.352275 \\ \hline
3  & 0.000137966 & 0.0721123 & 0.0618799   & 0.356982 \\ \hline
4  & 9.65964e-05 & 0.700145  & 0.0220162   & 0.35579  \\ \hline
5  & 4.75435e-06 & 0.0492187 & 0.00778282  & 0.353504 \\ \hline
6  & 6.58829e-06 & 1.38574   & 0.00276557  & 0.355342 \\ \hline
7  & 1.35074e-06 & 0.205021  & 0.000982237 & 0.355167 \\ \hline
8  & 4.77399e-07 & 0.353436  & 0.000349912 & 0.35624  \\ \hline
9  & 3.08057e-07 & 0.645281  & 0.000124776 & 0.356593 \\ \hline
10 & 8.15819e-08 & 0.264828  & 4.45777e-05 & 0.357261 \\ \hline
11 & 1.59989e-07 & 1.96109   & 1.59441e-05 & 0.35767  \\ \hline
12 & 1.31567e-07 & 0.822347  & 5.71026e-06 & 0.358142 \\ \hline
13 & 1.41493e-07 & 1.07544   & 2.04715e-06 & 0.358504 \\ \hline
14 & 1.38024e-07 & 0.975488  & 7.34646e-07 & 0.358862 \\ \hline
15 & 1.3925e-07  & 1.00888   & 2.63859e-07 & 0.359165 \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 512, V-Cycle, FullWeighting, Quadratic}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.00827043  & 0        & 6.74023     & 0        \\ \hline
2  & 0.00122806  & 0.148488 & 2.8106      & 0.416989 \\ \hline
3  & 0.000189082 & 0.153968 & 0.918794    & 0.326903 \\ \hline
4  & 3.07505e-05 & 0.16263  & 0.266494    & 0.290048 \\ \hline
5  & 5.22972e-06 & 0.170069 & 0.071993    & 0.270148 \\ \hline
6  & 9.16675e-07 & 0.175282 & 0.0186724   & 0.259364 \\ \hline
7  & 1.5468e-07  & 0.16874  & 0.00470096  & 0.25176  \\ \hline
8  & 2.24872e-08 & 0.145379 & 0.00115194  & 0.245043 \\ \hline
9  & 2.78403e-08 & 1.23805  & 0.000276706 & 0.24021  \\ \hline
10 & 3.33078e-08 & 1.19639  & 6.5486e-05  & 0.236663 \\ \hline
11 & 3.44325e-08 & 1.03377  & 1.53238e-05 & 0.234001 \\ \hline
12 & 3.46688e-08 & 1.00686  & 3.55472e-06 & 0.231974 \\ \hline
13 & 3.47193e-08 & 1.00146  & 8.19069e-07 & 0.230417 \\ \hline
14 & 3.47303e-08 & 1.00031  & 1.87742e-07 & 0.229214 \\ \hline
15 & 3.47326e-08 & 1.00007  & 4.28577e-08 & 0.22828  \\ \hline
\end{tabular}
\end{table}

\begin{table}[H]
\centering
\caption{n = 1024, V-Cycle, FullWeighting, Linear}
\begin{tabular}{|c|l|l|l|l|}
\hline
Iteration & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Ratio} & \multicolumn{1}{c|}{Residual} & \multicolumn{1}{c|}{Ratio} \\ \hline
1  & 0.0107284   & 0         & 0.542098    & 0        \\ \hline
2  & 0.00225438  & 0.210132  & 0.113796    & 0.209918 \\ \hline
3  & 0.000473038 & 0.20983   & 0.0298935   & 0.262694 \\ \hline
4  & 0.000100358 & 0.212156  & 0.0074943   & 0.2507   \\ \hline
5  & 2.13664e-05 & 0.212902  & 0.00181202  & 0.241787 \\ \hline
6  & 4.56072e-06 & 0.213453  & 0.000427424 & 0.235882 \\ \hline
7  & 9.70692e-07 & 0.212837  & 9.90441e-05 & 0.231723 \\ \hline
8  & 2.01741e-07 & 0.207832  & 2.26488e-05 & 0.228674 \\ \hline
9  & 3.67277e-08 & 0.182054  & 5.12705e-06 & 0.226372 \\ \hline
10 & 1.48099e-09 & 0.0403235 & 1.15149e-06 & 0.22459  \\ \hline
11 & 6.59681e-09 & 4.45433   & 2.57045e-07 & 0.223229 \\ \hline
12 & 8.23164e-09 & 1.24782   & 5.71163e-08 & 0.222203 \\ \hline
13 & 8.58552e-09 & 1.04299   & 1.33778e-08 & 0.23422  \\ \hline
14 & 8.66212e-09 & 1.00892   & 3.33594e-09 & 0.249364 \\ \hline
15 & 8.67873e-09 & 1.00192   & 8.275e-10   & 0.248056 \\ \hline
\end{tabular}
\end{table}

\subsubsection{Full multigrid cycle}
\begin{table}[H]
\centering
\caption{Full multigrid cycle, FullWeighting, Quadratic}
\begin{tabular}{|c|l|l|}
\hline
n    & \multicolumn{1}{c|}{Error} & \multicolumn{1}{c|}{Residual} \\ \hline
128  & 5.55793e-07                & 2.76625e-07                   \\ \hline
256  & 1.39041e-07                & 1.10742e-06                   \\ \hline
512  & 3.48658e-08                & 3.5704e-06                    \\ \hline
1024 & 8.83391e-09                & 1.04168e-05                   \\ \hline
\end{tabular}
\end{table}

\section{问题III的回答}
由于机器精度 $\epsilon_M \approx 2.22\times 10^{-16}$, 在计算过程中会产生舍入误差, 导致无法达到这个精度。在 n 逐渐增大的过程中, 相对误差总体呈下降趋势，下面列出相对误差随 n 的变化表(这里仅以一维非齐次边值情形为例)，可以看到当n增大时达到 $1 \times 10^{-14}$或者$1\times 10^{-15}$ 差不多就是极限了。
\begin{table}[H]
\centering
\caption{V-Cycle, FullWeighting, Quadratic}
\begin{tabular}{|c|c|}
\hline
n       & Error    \\ \hline
1024    & 2.08e-8  \\ \hline
16384   & 8.13e-11 \\ \hline
65536   & 4.40e-12 \\ \hline
131072  & 1.27e-12 \\ \hline
262144  & 3.16e-13 \\ \hline
524288  & 7.98e-14 \\ \hline
1048576 & 2.04e-14 \\ \hline
\end{tabular}
\end{table}

\end{spacing}
\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
